<script language='javascript'>

function $Nav(){
	if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
  else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
  else return "OT";
}

var preID = 0;

function OpenMenu(cid,lurl,rurl,bid){
   if($Nav()=='IE'){
     if(rurl!='') top.document.frames.main.location = rurl;
     if(cid > -1) top.document.frames.menu.location = 'index_menu.php?c='+cid;
     else if(lurl!='') top.document.frames.menu.location = lurl;
     if(bid>0) document.getElementById("d"+bid).className = 'thisclass';
     if(preID>0 && preID!=bid) document.getElementById("d"+preID).className = '';
     preID = bid;
   }else{
     if(rurl!='') top.document.getElementById("main").src = rurl;
     if(cid > -1) top.document.getElementById("menu").src = 'index_menu.php?c='+cid;
     else if(lurl!='') top.document.getElementById("menu").src = lurl;
     if(bid>0 && bid!=9) document.getElementById("d"+bid).className = 'thisclass';
     if(preID>0) document.getElementById("d"+preID).className = '';
     preID = bid;
   }
}

var preFrameW = '160,*';
var FrameHide = 0;
function ChangeMenu(way){
	var addwidth = 10;
	var fcol = top.document.all.bodyFrame.cols;
	if(way==1) addwidth = 10;
	else if(way==-1) addwidth = -10;
	else if(way==0){
		if(FrameHide == 0){
			preFrameW = top.document.all.bodyFrame.cols;
			top.document.all.bodyFrame.cols = '0,*';
			FrameHide = 1;
			return;
		}else{
			top.document.all.bodyFrame.cols = preFrameW;
			FrameHide = 0;
			return;
		}
	}
	fcols = fcol.split(',');
	fcols[0] = parseInt(fcols[0]) + addwidth;
	top.document.all.bodyFrame.cols = fcols[0]+',*';
}

function resetBT(){
	if(preID>0) document.getElementById("d"+preID).className = 'bdd';
	preID = 0;
}

    function onActionClick(flag)
    {
        switch(flag)
        {
            case "content":
               parent.leftFrame.location.href='<?php echo url_for("system/contentMenu"); ?>';
               break;
            case "function":
               parent.leftFrame.location.href='<?php echo url_for("system/functionMenu"); ?>';
               break;
            case "user":
               parent.leftFrame.location.href='<?php echo url_for("system/userMenu"); ?>';
               break;
            case "system":
               parent.leftFrame.location.href='<?php echo url_for("system/systemMenu"); ?>';
               break;
            case "catalog":
               parent.leftFrame.location.href='<?php echo url_for("system/catalogMenu"); ?>';
               break;
        }
    }
    function onLogout()
    {
        var random = Math.random();
        $.ajax({url:"<?php echo url_for("other/jQuery");?>",data:"random=" + random +"&submitFlag=logout" ,success: onSuccessLogin,error:onErrorLogin})
    }
    function onSuccessLogin(oMessage)
    {
        if(oMessage == "ok")
        {
            window.top.location='<?php echo url_for("system/login");?>';
        }
        else
        {
            alert("注销登录时，系统出现问题。");
        }
    }

    function onErrorLogin(x, e)
    {

    }
</script>
<div class="topnav">
	<div class="sitenav">
		<div class="sitelink">
			你好：<span class="username"><?php echo $sf_user->getAttribute("adminUserName");?> </span>&nbsp;&nbsp;<span style="cursor:pointer;" onclick="onLogout()">注销登录</span>
		</div>
		<div class="welcome">
<!--		<a href="javascript:ChangeMenu(-1)"><img src='img/frame-l.gif' border='0' alt="减小左框架"></a>-->
<!--    <a href="javascript:ChangeMenu(0)"><img src='img/frame_on.gif' border='0' alt="隐藏/显示左框架"></a>-->
<!--    <a href="javascript:ChangeMenu(1)" title="增大左框架"><img src='img/frame-r.gif' border='0' alt="增大左框架"></a>-->
    </div>
<!--		<div class="sitelink">-->
<!--			<a href="javascript:OpenMenu(9,'','index_body.php',0)">管理主页</a> |-->
<!--			<a href="javascript:OpenMenu(0,'index_menu.php','',0)">功能菜单</a> |-->
<!--			<a href="http://www.dedecms.com/archives/templethelp/help/index.htm" target="_blank">帮助</a> |-->
<!--			<a href="../" target="_blank">网站主页</a> |-->
<!--			<a href="exit.php" target="_parent">注销登录</a>-->
<!--		</div>-->
	</div>
	<div class="leftnav">
		<ul>
			<li class="navleft"></li>
			<li id='d1'><a href="javascript:onActionClick('function')">功能管理</a></li>
			<li id='d2'><a href="javascript:onActionClick('catalog')">栏目管理</a></li>
			<li id='d3'><a href="javascript:onActionClick('content')">内容管理</a></li>
			<li id='d4'><a href="javascript:onActionClick('user')">用户管理</a></li>
            <li id='d10'><a href="javascript:onActionClick('system')">系统管理</a></li>
<!--			<li id='d5'><a href="javascript:OpenMenu(4,'','member_main.php',5)">系统管理</a></li>-->
<!--			<li id='d7'><a href="javascript:OpenMenu(6,'','module_main.php',7)">扩展模块</a></li>-->
<!--			<li id='d6'><a href="javascript:OpenMenu(5,'','plus_main.php',6)">辅助插件</a></li>-->
<!--			<li id='d8'><a href="javascript:OpenMenu(7,'','sys_info.php',8)">系统管理</a></li>-->
			<li class="navright"></li>
		</ul>
	</div>
</div>
